package com.competition.prediction.mapper;

import com.competition.prediction.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    int insertUser(User user);

    int updateUser(User user);

    int deleteUserById(Long id);

    User selectUserById(Long id);

    User selectUserByUsername(@Param("username") String username);

    User selectUserByEmail(@Param("email") String email);

    User selectUserByPhone(@Param("phone") String phone);

    List<User> selectAllUsers();

    int updateUserCoins(@Param("userId") Long userId, @Param("coins") Long coins);
}